public class Solution1790 {
    public boolean areAlmostEqual(String s1, String s2) {
        if (s1.equals(s2)){
            return true;
        }
        int count=0;
        char[] c=new char[300];
        for (int i=0;i<s1.length();i++){
            if (s1.charAt(i)!=s2.charAt(i)){
                c[count++]=s1.charAt(i);
                c[count++]=s2.charAt(i);
            }
        }
        return count == 4 && c[0] == c[3] && c[1] == c[2];
    }

    public static void main(String[] args) {
        System.out.println(new Solution1790().areAlmostEqual("bank","kanb"));
    }
}
